<template>
  <div>
    <Common :baseUrl :rules>
      <template #content="{ formData, controlLine }">
        <el-row>
          <el-col :span="12">
            <el-form-item prop="upLine" :show-message="false">
              <div class="config-line-checkbox">
                <el-checkbox
                  v-model="controlLine.hasUp"
                  style="margin-right: 10px"
                  >控制线上限比例
                </el-checkbox>
                <el-input v-model="formData.upLine" style="width: 60px">
                  <template #suffix> % </template>
                </el-input>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item prop="downLine" :show-message="false">
              <div class="config-line-checkbox">
                <el-checkbox
                  v-model="controlLine.hasDown"
                  style="margin-right: 10px"
                >
                  控制线下限比例
                </el-checkbox>
                <el-input v-model="formData.downLine" style="width: 60px">
                  <template #suffix> % </template>
                </el-input>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row
          style="display: flex; justify-content: center; margin-bottom: 20px"
        >
          <!--          <el-card>-->
          <p>
            样例：
            <br />
            上限：23.967   下限：23.943
            <br />
            控制上限  23.967  -（23.967 - 23.943）*（1-90%）
            <br />
            控制下限  23.943 +（23.967 - 23.943）*（1-85%）
            <br />
            如果上限或下限其中一项为0，不计算对应控制线。
          </p>
          <!--          </el-card>-->
        </el-row>
      </template>
    </Common>
  </div>
</template>
<script setup lang="ts">
import Common from "@/views/qms/pcm/pcmsystemconfig/components/common.vue";

defineOptions({
  name: "PCMPCMSPECIALRULECOMMONCONFIGLINE",
});

const baseUrl = "pcmconfigline";

const rules = {
  upLine: [
    {
      pattern: /^([0-9]{0,5})$/,
      message: "只能请输入五位正整数",
      trigger: ["blur", "change"],
    },
  ],
  downLine: [
    {
      pattern: /^([0-9]{0,5})$/,
      message: "只能请输入五位正整数",
      trigger: ["blur", "change"],
    },
  ],
};
</script>

<style scoped lang="scss">
.config-line-checkbox {
  display: flex;
}
</style>
